﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;

namespace Umbrella.Whs.Service.Activities.SharePoint
{

    public sealed class DeleteWindowsService : SafeCodeActivity
    {
        [RequiredArgument]
        public InArgument<string> ServiceName { get; set; }

        // If your activity returns a value, derive from CodeActivity<TResult>
        // and return the value from the Execute method.
        protected override void ExecuteSafe(CodeActivityContext context)
        {
            var sn = context.GetValue(this.ServiceName);

            // run
            var rp = new RunProcessLogged(
                "sc",
                "delete " + sn,
                null
                );

            rp.Run();
        }
    }
}
